Skip to content

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Oct 7, 2025

Move it to the internal C API and no longer export it.

Move it to the internal C API and no longer export it.
@vstinner
Copy link
Member Author

vstinner commented Oct 7, 2025

The _PyObject_SetManagedDict() function is private, not documented, and not tested.

It's used by _PyObject_SetDict() which belongs to the internal C API and is not exported.

A code search in PyPI top 15,000 projects did not find any project using it.

The function was added by commit 8b541c0.

@DinoV: Did you add this function to the public C API on purpose?

cc @colesbury who modified the function.

@vstinner
Copy link
Member Author

Well, let me remove this function. It can be added back easily if things go wrong.

It's used by _PyObject_SetDict() which belongs to the internal C API and is not exported.

See also #139852 discussion about _PyObject_GetDictPtr() and maybe adding an idea to set the dictionary.

@vstinner vstinner merged commit 5f91d5d into python:main Oct 12, 2025
47 checks passed
@vstinner vstinner deleted the remove_set_managed_dict branch October 12, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant